/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2015
 */

package com.environment_pro.monitor.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.environment_pro.monitor.util.StaticUtil;

/**
 * @author yangfeng 
 * @version 1.0
 * @since 1.0
 */


public class TbDevice implements java.io.Serializable{

	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "TbDevice";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_ROOM_NUM = "设备所属机房";
	public static final String ALIAS_DEV_NAME = "设备名称";
	public static final String ALIAS_DEV_MAC_ADDRESS = "设备编码";
	public static final String ALIAS_DEV_TYPE = "设备类型";
	public static final String ALIAS_PIC_POSITION = "位置信息（图片位置信息）";
	public static final String ALIAS_ADD_TIME = "添加日期";
	public static final String ALIAS_PRODUCT = "生产厂商";
	public static final String ALIAS_PRODUCT_MODEL = "型号";
	public static final String ALIAS_PRODUCT_MOBILE = "生产厂商电话";
	public static final String ALIAS_VALID = "旁路（boolean）";
	public static final String ALIAS_TYPE = "告警类型";
	public static final String ALIAS_ALARM_UP = "告警上限";
	public static final String ALIAS_ALARM_DOWN = "告警下限";
	public static final String ALIAS_ALARM_OPEN = "告警开关";
	public static final String ALIAS_REMARK = "备注";
	
	
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	private java.lang.Integer id;

	private java.lang.String roomNum;

	private java.lang.String devName;

	private java.lang.String devMacAddress;

	private java.lang.String devType;

	private java.lang.String picPosition;

	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private  java.util.Date addTime;

	private java.lang.String product;

	private java.lang.String productModel;

	private java.lang.String productMobile;

	private java.lang.Integer valid;

	private java.lang.String type;

	private java.lang.String alarmUp;

	private java.lang.String alarmDown;

	private java.lang.String alarmOpen;

	private java.lang.String remark;

	//columns END

	//date String
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private java.util.Date addTimeBegin;

	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") 
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	private java.util.Date addTimeEnd;

	public TbDevice(){
	}

	public TbDevice(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setRoomNum(java.lang.String value) {
		this.roomNum = value;
	}
	
	public java.lang.String getRoomNum() {
		return this.roomNum;
	}
	public void setDevName(java.lang.String value) {
		this.devName = value;
	}
	
	public java.lang.String getDevName() {
		return this.devName;
	}
	public void setDevMacAddress(java.lang.String value) {
		this.devMacAddress = value;
	}
	
	public java.lang.String getDevMacAddress() {
		return this.devMacAddress;
	}
	public void setDevType(java.lang.String value) {
		this.devType = value;
	}
	
	public java.lang.String getDevType() {
		return this.devType;
	}
	public void setPicPosition(java.lang.String value) {
		this.picPosition = value;
	}
	
	public java.lang.String getPicPosition() {
		return this.picPosition;
	}

	public void setAddTimeBegin(java.util.Date value) {
		this.addTimeBegin = value;
	}
	
	public java.util.Date getAddTimeBegin() {
		return this.addTimeBegin;
	}

	public void setAddTimeEnd(java.util.Date value) {
		this.addTimeEnd = value;
	}
	
	public java.util.Date getAddTimeEnd() {
		return this.addTimeEnd;
	}
	
	public void setAddTime(java.util.Date value) {
		this.addTime = value;
	}
	
	public java.util.Date getAddTime() {
		return this.addTime;
	}
	public void setProduct(java.lang.String value) {
		this.product = value;
	}
	
	public java.lang.String getProduct() {
		return this.product;
	}
	public void setProductModel(java.lang.String value) {
		this.productModel = value;
	}
	
	public java.lang.String getProductModel() {
		return this.productModel;
	}
	public void setProductMobile(java.lang.String value) {
		this.productMobile = value;
	}
	
	public java.lang.String getProductMobile() {
		return this.productMobile;
	}
	public void setValid(java.lang.Integer value) {
		this.valid = value;
	}
	
	public java.lang.Integer getValid() {
		return this.valid;
	}
	public void setType(java.lang.String value) {
		this.type = value;
	}
	
	public java.lang.String getType() {
		return this.type;
	}
	public void setAlarmUp(java.lang.String value) {
		this.alarmUp = value;
	}
	
	public java.lang.String getAlarmUp() {
		return this.alarmUp;
	}
	public void setAlarmDown(java.lang.String value) {
		this.alarmDown = value;
	}
	
	public java.lang.String getAlarmDown() {
		return this.alarmDown;
	}
	public void setAlarmOpen(java.lang.String value) {
		this.alarmOpen = value;
	}
	
	public java.lang.String getAlarmOpen() {
		return this.alarmOpen;
	}
	public void setRemark(java.lang.String value) {
		this.remark = value;
	}
	
	public java.lang.String getRemark() {
		return this.remark;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("RoomNum",getRoomNum())
			.append("DevName",getDevName())
			.append("DevMacAddress",getDevMacAddress())
			.append("DevType",getDevType())
			.append("PicPosition",getPicPosition())
			.append("AddTime",getAddTime())
			.append("Product",getProduct())
			.append("ProductModel",getProductModel())
			.append("ProductMobile",getProductMobile())
			.append("Valid",getValid())
			.append("Type",getType())
			.append("AlarmUp",getAlarmUp())
			.append("AlarmDown",getAlarmDown())
			.append("AlarmOpen",getAlarmOpen())
			.append("Remark",getRemark())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof TbDevice == false) return false;
		if(this == obj) return true;
		TbDevice other = (TbDevice)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

